package ar.edu.itba.it.cg.grupo01.impl.scene;

import static com.google.common.base.Preconditions.checkNotNull;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import ar.edu.itba.it.cg.grupo01.api.scene.Scene;
import ar.edu.itba.it.cg.grupo01.api.shape.Shape;
import ar.edu.itba.it.cg.grupo01.api.shape.light.Light;
import ar.edu.itba.it.cg.grupo01.impl.shape.Plane;

import com.google.common.collect.ImmutableList;

public class SceneImpl implements Scene {

	private List<Shape> shapes;
	private List<Plane> planes;
	private List<Light> lights;

	public SceneImpl(Collection<? extends Shape> shapes, Collection<? extends Plane> planes, Collection<? extends Light> lights) {
		checkNotNull(shapes, "Shapes should not be null");
		this.shapes = ImmutableList.copyOf(shapes);
		this.planes = ImmutableList.copyOf(planes);
		this.lights = ImmutableList.copyOf(lights);
	}

	@Override
	public List<Shape> getShapes() {
		return ImmutableList.copyOf(shapes);
	}

	@Override
	public Iterator<Shape> iterator() {
		return shapes.iterator();
	}

	@Override
	public List<Light> getLights() {
		return ImmutableList.copyOf(lights);
	}

	@Override
	public List<Plane> getPlanes() {
		return ImmutableList.copyOf(planes);
	}

}
